package com.iwomy.secureplat.platform.transmission;

import com.iwomy.secureplat.platform.transmission.parse.ParseData;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import lombok.extern.slf4j.Slf4j;


@Slf4j
public class ServerChannelInitializer extends ChannelInitializer<SocketChannel> {
	private ParseData parseData;

	public ServerChannelInitializer(ParseData parseData) {
		this.parseData = parseData;
	}

	@Override
	protected void initChannel(SocketChannel socketChannel) {
		ChannelPipeline pipeline = socketChannel.pipeline();
		pipeline.addLast(new DataDecoder(this.parseData));
		pipeline.addLast(new DataServerHandler(this.parseData));

	}
}